package com.bite.friend.domain.question;

import com.baomidou.mybatisplus.annotation.*;
import com.bite.common.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("tb_question")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Question extends BaseEntity {

    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(value = "QUESTION_ID", type = IdType.ASSIGN_ID)
    @Schema(description = "题目id")
    private Long questionId;

//	@JsonSerialize(using = ToStringSerializer.class)
//	@Schema(description = "竞赛id")
//	private Long examId;

    @Schema(description = "题目标题")
    private String title;

    @Schema(description = "题目内容")
    private String content;

    @Schema(description = "默认代码块")
    private String defaultCode;

//	@Schema(description = "题目答案")
//	private String answer;

    @Schema(description = "题目用例")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String questionCase;

    @Schema(description = "时间限制")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private Long timeLimit;

    @Schema(description = "空间限制")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private Long spaceLimit;

    @Schema(description = "题目难度")
    private Integer difficulty;

    @Schema(description = "main函数")
    private String mainFunc;
}
